package com.lmm.rpc.core.proxy;

import java.lang.reflect.InvocationHandler;

import static com.lmm.rpc.core.util.ClassUtil.getCurrentClassLoader;

/**
 * 代理工厂
 * */
public interface ProxyFactory {

    default <T> T getProxy(final Class<T> clz, final InvocationHandler invoker) throws ProxyException {
        return getProxy(clz, invoker, getCurrentClassLoader());
    }

    <T> T getProxy(Class<T> clz, InvocationHandler invoker, ClassLoader classLoader) throws ProxyException;
}
